package huawei_nowcoder;

import java.util.Comparator;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

/**
 * @order  3
 * @decription 明明的随机数
 */
public class Random {
    public static void main(String[] args) {

        //可以排序的set(本身去重)
        Set<Integer> set=new TreeSet<Integer>(
                new Comparator<Integer>() {
                    @Override
                    public int compare(Integer o1, Integer o2) {
                        return o1.compareTo(o2);  //数字顺序排列
                    }
                }
        );

        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            int n=scanner.nextInt();

            //手动输入
            int[] params=new int[n];
            for (int i = 0; i < n; i++) {
                int t=scanner.nextInt();
                if (t<1000 && t>0)
                    params[i]=t;
                else
                    System.out.println("输入数字不合规");
//            System.out.println("参数为："+params[i]);
                set.add(params[i]);
            }
            //打印
            for (Integer i:set
            ) {
                System.out.println(i);
            }

            set.clear();
        }
    }
}
